package chapter4

import "fmt"

func test4()(z int)  {
	defer func() {
		fmt.Println("defer:",z)
		z+=100
	}()
	return 100
}

func prints(i int){
	fmt.Println(i,"开始")
	fmt.Println(i,"在进展")
}


func Test4()  {
	x,y:=1,2
	defer func(x int) {
		fmt.Println("defer :",x,y)
	}(x)
	x+=10
	y+=10
	fmt.Println(test4())
	fmt.Println("---------------------------")
	for i:=0;i<10;i++{
		prints(i)
	}

}
